<?php
namespace app\common\model;

class RecycleOrderModel extends Model {
	
	protected $table = 'recycle_order';
	protected $id = 'id';
	protected $type = array(
		'id' => 'integer',
		'subscriber_id' => 'integer',
		'genre' => 'integer',
		'parent_id' => 'integer',
		'action_date' => 'integer',
		'action_time' => 'string',
		'remark' => 'string',
		'liaison_name' => 'string',
		'liaison_phone' => 'string',
		'position_lat' => 'float',
		'position_lng' => 'float',
		'region_province' => 'integer',
		'region_city' => 'integer',
		'region_district' => 'integer',
		'address' => 'string',
		'address_describe' => 'string',
		'status' => 'integer',
		'create_time' => 'integer',
		'accept_time' => 'integer',
		'finish_time' => 'integer',
		'cancel_time' => 'integer',
		'cancel_cause' => 'string',
		'is_del' => 'integer',
		'staff_id' => 'integer',
		'score' => 'integer',
	);
	
	public static $status = array(
		0 => '已取消',
		1 => '待接收',
		2 => '已接收',
		3 => '已完成',
	);
	public function getStatusName() {
		return self::disposeAttr(self::$status, $this->getData('status'));
	}
	
	public static $status_alias = array(
		0 => 'cancel',
		1 => 'waiting',
		2 => 'process',
		3 => 'complete',
	);
	
	public static $genre = array(
		1 => '单次预约',
		2 => '长期预约',
	);
	public function getGenreName() {
		return self::disposeAttr(self::$genre, $this->getData('genre'));
	}
}